home *** CD-ROM | disk | FTP | other *** search
- /*
- File: Selectorama.r
-
- Copyright (c) 1996, Adobe Systems Incorporated.
- All rights reserved.
- */
-
- /***************************************************************/
- /* Defines required by include files */
-
- #define plugInName "Selectorama"
- #define VersionString "4.0"
-
- /***************************************************************/
-
- #if Macintosh
- #include "Types.r"
- #include "SysTypes.r"
- #include "PIGeneral.r"
- #include "PIUtilities.r"
- #incldue "DialogUtilities.r"
- #endif
-
- #if MSWindows
- #include "PIGeneral.h"
- #include "PIUtilities.r"
- #include "WinDialogUtils.r"
- #endif
-
- #include "PIActions.h"
-
- /********************************************************************************/
-
- #define plugInComment "selectorama example selection plug-in"
- #define vendorName "AdobeSDK"
-
- #define ourSuiteID 'sdK7'
- #define ourClassID ourSuiteID
- #define ourEventID 'selM'
- #define selectMin 'seL0'
- #define selectMax 'seL1'
- #define selectRandom 'shL2'
- #define useTarget 'useT'
- #define useMerged 'useM'
- #define typeSelect 'tseL'
- #define typeComposite 'tcoM' // targetCompositeChannels, mergedCompositeChannels
- #define keyCreate 'kcrE'
- #define typeCreate 'tcrE'
- #define createSelection 'crE0'
- #define createMaskpath 'crE1'
- #define createLayer 'crE2'
-
- #define errCantCreatePath 16989
-
- /*************************************************************/
-
- resource 'PiPL' (ResourceID, purgeable)
- {
- {
- Kind { Selection },
- Name { plugInName "..." },
- Category { vendorName },
- Version { (latestSelectionVersion << 16) | latestSelectionSubVersion },
-
- HasTerminology { ourClassID, ourEventID, ResourceID, "" },
- /* classID, eventID, aete ID, uniqueString */
-
- EnableInfo { "true" },
-
- #if Macintosh
- Code68K { Selection, $$ID },
- CodePowerPC { 0, 0, "" },
- #endif
-
- #if MSWindows
- CodeWin32X86 { "ENTRYPOINT" },
- #endif
- }
- };
-
- /* About resources */
-
- resource StringResource (AboutID, "About Text", purgeable)
- {
- plugInName "\n\n"
- "Version " VersionString " "
- "Release " ReleaseString "\n"
- "Copyright ⌐ 1996, Adobe Systems Incorporated.\n"
- "All rights reserved.\n\n"
- "An example plug-in selection module for Adobe Photoshop¿."
- };
-
- /* Error strings */
-
- resource StringResource (errCantCreatePath, "No paths", purgeable)
- {
- "paths cannot be made from pixel selections"
- };
-
- /* Parameters Dialog */
-
- resource 'DLOG' (ResourceID+1, "UI", purgeable)
- {
- {259, 337, 383, 729},
- movableDBoxProc,
- visible,
- noGoAway,
- 0x0,
- ResourceID+1,
- plugInName
- };
-
- resource 'DITL' (ResourceID+1, "UI", purgeable)
- {
- { /* array DITLarray: 16 elements */
- /* [1] */
- {8, 312, 28, 380},
- Button {
- enabled,
- "OK"
- },
- /* [2] */
- {36, 315, 56, 379},
- Button {
- enabled,
- "Cancel"
- },
- /* [3] */
- {8, 35, 36, 76},
- StaticText {
- disabled,
- "Area:"
- },
- /* [4] */
- {8, 79, 24, 183},
- RadioButton {
- enabled,
- "Minimum"
- },
- /* [5] */
- {24, 79, 40, 183},
- RadioButton {
- enabled,
- "Maximum"
- },
- /* [6] */
- {40, 79, 56, 159},
- RadioButton {
- enabled,
- "Random"
- },
- /* [7] */
- {40, 167, 64, 231},
- StaticText {
- disabled,
- "Amount:"
- },
- /* [8] */
- {39, 235, 56, 264},
- EditText {
- enabled,
- "50"
- },
- /* [9] */
- {40, 267, 64, 287},
- StaticText {
- disabled,
- "%"
- },
- /* [10] */
- {72, 7, 100, 77},
- StaticText {
- disabled,
- "Channels:"
- },
- /* [11] */
- {72, 79, 88, 160},
- RadioButton {
- enabled,
- "Target"
- },
- /* [12] */
- {88, 79, 104, 160},
- RadioButton {
- enabled,
- "Merged"
- },
- /* [13] */
- {72, 171, 100, 228},
- StaticText {
- disabled,
- "Create:"
- },
- /* [14] */
- {72, 227, 88, 331},
- RadioButton {
- enabled,
- "Selection"
- },
- /* [15] */
- {88, 227, 104, 331},
- RadioButton {
- enabled,
- "Path"
- },
- /* [16] */
- {104, 227, 120, 331},
- RadioButton {
- enabled,
- "Layer"
- }
- }
- };
-
- /* Scripting dictionary resource */
-
- resource 'aete' (ResourceID, purgeable)
- {
- 1, 0, english, roman, /* aete version and language specifiers */
- {
- vendorName, /* vendor suite name */
- "Adobe example plug-ins", /* optional description */
- ourSuiteID, /* suite ID */
- 1, /* suite code, must be 1 */
- 1, /* suite level, must be 1 */
- { /* structure for filters */
- vendorName " selectorama", /* unique selection name */
- "selectorama plug-in", /* optional description */
- ourClassID, /* class ID, must be unique or Suite ID */
- ourEventID, /* event ID, must be unique */
-
- NO_REPLY, /* never a reply */
- IMAGE_DIRECT_PARAMETER, /* direct parameter, used by Photoshop */
- { /* parameters here, if any */
- "select area", /* parameter name */
- keyArea, /* parameter key ID */
- typeSelect, /* parameter type ID */
- "selection area", /* optional description */
- flagsEnumeratedParameter, /* parameter flags */
-
- "amount", /* parameter name */
- keyAmount, /* parameter key ID */
- typeFloat, /* parameter type ID */
- "random amount", /* optional description */
- flagsSingleParameter, /* parameter flags */
-
- "use channels from", /* parameter name */
- keyChannels, /* key ID */
- typeComposite, /* type ID */
- "use composite target or merged", /* optional descript */
- flagsEnumeratedParameter,
-
- "create", /* parameter name */
- keyCreate, /* parameter key ID */
- typeCreate, /* parameter type ID */
- "create type", /* optional description */
- flagsEnumeratedParameter /* parameter flags */
-
-
- }
- },
- {}, /* non-filter plug-in class here */
- {}, /* comparison ops (not supported) */
- { /* enumerations */
- typeSelect, /* type select 'tseL' */
- {
- "minimum", /* first value */
- selectMin, /* 'seL0' */
- "select minimum", /* optional description */
-
- "maximum", /* second value */
- selectMax, /* 'seL1' */
- "select maximum", /* optional description */
-
- "random", /* third value */
- selectRandom, /* 'seL2' */
- "select random" /* optional description */
- },
-
- typeComposite, /* type 'tcoM' */
- {
- "target", /* use target composite */
- useTarget, /* 'useT' */
- "use target composite", /* optional descript */
-
- "merged", /* use merged channels */
- useMerged, /* 'useM' */
- "use merged composite" /* optional descript */
- },
-
- typeCreate, /* type shape 'tshP' */
- {
- "selection", /* first value */
- createSelection, /* 'crE0' */
- "make selection", /* optional description */
-
- "mask path", /* second value */
- createMaskpath, /* 'crE1' */
- "make mask path", /* optional description */
-
- "layer", /* third value */
- createLayer, /* 'crE2' */
- "make layer" /* optional description */
- }
- } /* other enumerations */
- }
- };